﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Admin_Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../Styles.css" type="text/css" rel="stylesheet">
</head>
<body>
		<form id="Form1" method="post" runat="server">
			<h1>Question Administration</h1>
			<h2><a href="CreateQuestion.aspx">Create a Question</a></h2>
<%--			<p>
				The first step in customizing a user's data entry screen is formulating the 
				dynamic questions. Use this screen to create a dynamic question by specifying 
				the question's text, the data type of the result, and the path to the User 
				Control that contains the question's user interface.
			</p>--%>
			<h2><a href="AssignQuestionsToHotDeal.aspx">Assign Question to Hot Deal</a></h2>
<%--			<p>
				Once you have some questions, you can specify what questions a customer with a 
				particular customer type will be asked. In this screen, you will be prompted to 
				choose the questions and the order with which they appear for a specified 
				customer type.
			</p>--%>
			<P><hr>
			<P></P>
			<P><h2>Current Hot Deal Questions</h2>
				<asp:DataGrid Runat="server" ID="dgCustomerTypes" AutoGenerateColumns="False" CellPadding="4"
					BackColor="White" BorderWidth="1px" BorderStyle="None" BorderColor="#CC9966">
					<FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
					<SelectedItemStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle>
					<ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle>
					<HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" BackColor="#990000"></HeaderStyle>
					<Columns>
						<asp:BoundColumn DataField="Title" HeaderText="Hot Deal">
							<ItemStyle VerticalAlign="Top"></ItemStyle>
						</asp:BoundColumn>
						<asp:TemplateColumn HeaderText="Questions">
							<ItemTemplate>
								<asp:Repeater Runat="server" DataSource='<%# GetQuestionsForHotDeal(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "HotDealID"))) %>' ID="Repeater1">
									<HeaderTemplate>
										<ul>
									</HeaderTemplate>
									<ItemTemplate>
										<li>
											<%# DataBinder.Eval(Container.DataItem, "QuestionTextAndControlSrc") %>
										</li>
									</ItemTemplate>
									<FooterTemplate>
										</ul>
									</FooterTemplate>
								</asp:Repeater>
							</ItemTemplate>
						</asp:TemplateColumn>
					</Columns>
					<PagerStyle HorizontalAlign="Center" ForeColor="#330099" BackColor="#FFFFCC"></PagerStyle>
				</asp:DataGrid>
<P></P><P>
				<h2>Current Customers</h2>
				<asp:DataGrid id="dgCustomers" runat="server" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
					BackColor="White" CellPadding="4" AutoGenerateColumns="False">
					<FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
					<SelectedItemStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle>
					<ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle>
					<HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" BackColor="#990000"></HeaderStyle>
					<Columns>
						<asp:BoundColumn DataField="Name" HeaderText="Customer"></asp:BoundColumn>
						<asp:BoundColumn DataField="CustomerTypeName" HeaderText="Hot Deal"></asp:BoundColumn>
					</Columns>
					<PagerStyle HorizontalAlign="Center" ForeColor="#330099" BackColor="#FFFFCC"></PagerStyle>
				</asp:DataGrid>
<P></P><P>
				<h2>All Available Questions</h2>
				<asp:DataGrid id="dgQuestions" runat="server" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
					BackColor="White" CellPadding="4" AutoGenerateColumns="False">
					<FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
					<SelectedItemStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle>
					<ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle>
					<HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" BackColor="#990000"></HeaderStyle>
					<Columns>
						<asp:BoundColumn DataField="QuestionText" HeaderText="Question"></asp:BoundColumn>
						<asp:BoundColumn DataField="ControlSrc" HeaderText="User Control"></asp:BoundColumn>
						<asp:TemplateColumn>
							<ItemTemplate>
								<asp:HyperLink ID="HyperLink1" runat="server" Text="Preview" NavigateUrl='<%# "PreviewUC.aspx?Src=" & Server.UrlEncode(DataBinder.Eval(Container, "DataItem.ControlSrc").ToString()) & "&Question=" & Server.UrlEncode(DataBinder.Eval(Container, "DataItem.QuestionText").ToString()) %>' Target="_blank">
								</asp:HyperLink>
							</ItemTemplate>
						</asp:TemplateColumn>
					</Columns>
					<PagerStyle HorizontalAlign="Center" ForeColor="#330099" BackColor="#FFFFCC"></PagerStyle>
				</asp:DataGrid>
<P></P>
		</form>
</body>
</html>
